package com.yiwannuofulasi.oauth.web;

import com.yiwannuofulasi.oauth.api.OauthClientDetailsCustomService;
import com.yiwannuofulasi.oauth.dto.OauthClientDetailsListByClientNameQry;
import com.yiwannuofulasi.oauth.dto.data.OauthDTO;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author yiwannuofulasi
 * @description TODO
 * @date 2023/4/20 16:25
 * Copyright (c) 2023/4/20 by yiwannuofulasi yiwannuofulasi@163.com, by 新疆兵团勘测设计院（集团）有限公司 All Rights Reserved.
 */
@Api(value = "OauthClientDetailsController",tags = {"授权客户端应用信息表管理"})
@RestController
@RequestMapping("/oauth/client-details")
public class OauthClientDetailsController {

    @Resource
    private OauthClientDetailsCustomService oauthClientDetailsCustomService;

    @GetMapping(value = "/hello")
    public String helloWorld(){
        return "Hello, welcome to ddd-cola-anatomy world!";
    }

    @GetMapping(value = "/oauth")
    public List<OauthDTO> queryOauthClientDetailsListByClientName(String clientName){
        OauthClientDetailsListByClientNameQry oauthClientDetailsListByClientNameQry = new OauthClientDetailsListByClientNameQry();
        oauthClientDetailsListByClientNameQry.setClientName(clientName);
        return oauthClientDetailsCustomService.queryOauthClientDetailsListByClientName(oauthClientDetailsListByClientNameQry);
    }
}
